﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace AutoMapperLibraryTest
{
    class Program
    {
        static void Main(string[] args)
        {
            //源数据对象转成目标对象
            DogDto dogDto = new DogDto
            {
                Age = 12,
                Id = 1,
                Name = "旺财"
            };
            //Dog dog=AutoMapperHelpLibrary.AutoMapperHelper.MapTo<Dog>(dogDto);
            //Console.WriteLine(dog.Id);
            //Console.WriteLine(dog.Age);
            //Console.WriteLine(dog.Name);



            //源数据对象替换目标对象（一般用于修改）
            Dog dog1 = new Dog
            {
                Id = 2,
                Age = 33,
                Name = "旺财",
                Address = "china"
            };
            Dog dog = AutoMapperHelpLibrary.AutoMapperHelper.MapTo<DogDto, Dog>(dogDto, dog1);
            Console.WriteLine(dog.Id);
            Console.WriteLine(dog.Age);
            Console.WriteLine(dog.Name);
            Console.WriteLine(dog.Address);



            Console.Read();
        }
    }
}
